//
//  ViewController.m
//  ScrollDemo
//
//  Created by chen on 16/5/25.
//  Copyright (c) 2016年 chen. All rights reserved.
//

#import "IntroViewController.h"

@interface IntroViewController ()<UIScrollViewDelegate>

@end

@implementation IntroViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    
    UIScrollView *scrollView =[[UIScrollView alloc]initWithFrame:self.view.frame];
    scrollView.backgroundColor=[UIColor whiteColor];
    scrollView.delegate=self;
    scrollView.contentSize=CGSizeMake(self.view.frame.size.width*4, self.view.frame.size.height);
    scrollView.bounces=NO;
    scrollView.pagingEnabled=YES;
    scrollView.scrollEnabled=YES;
    
    UIImageView *imageView1=[[UIImageView alloc]initWithFrame:self.view.frame];
    imageView1.image=[UIImage imageNamed:@"page_1_640×1136"];
    imageView1.contentMode=UIViewContentModeScaleToFill;
    [scrollView addSubview:imageView1];
    UIImageView *imageView2=[[UIImageView alloc]initWithFrame:CGRectMake(self.view.frame.size.width*1, 0, self.view.frame.size.width, self.view.frame.size.height)];
    imageView2.image=[UIImage imageNamed:@"page_2_640×1136"];
    imageView2.contentMode=UIViewContentModeScaleToFill;
    [scrollView addSubview:imageView2];
    UIImageView *imageView3=[[UIImageView alloc]initWithFrame:CGRectMake(self.view.frame.size.width*2, 0, self.view.frame.size.width, self.view.frame.size.height)];
    imageView3.image=[UIImage imageNamed:@"page_3_640×1136"];
    imageView3.contentMode=UIViewContentModeScaleToFill;
    [scrollView addSubview:imageView3];
    UIImageView *imageView4=[[UIImageView alloc]initWithFrame:CGRectMake(self.view.frame.size.width*3, 0, self.view.frame.size.width, self.view.frame.size.height)];
    imageView4.image=[UIImage imageNamed:@"page_4_640×1136"];
    imageView4.contentMode=UIViewContentModeScaleToFill;
    [scrollView addSubview:imageView4];
    imageView4.userInteractionEnabled=YES;
    UITapGestureRecognizer *singleTap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(next)];
    [imageView4 addGestureRecognizer:singleTap];
    
    [self.view addSubview:scrollView];

    
    
    
}

-(void)next
{
   // [self.navigationController presentViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"FirstVC"] animated:YES completion:nil];
    UIViewController *FirstVC=[[UIViewController alloc]init];
    FirstVC.view.backgroundColor=[UIColor whiteColor];
    FirstVC.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
    FirstVC.modalPresentationStyle=UIModalPresentationFormSheet;
    [self presentViewController:FirstVC animated:YES completion:nil];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
